import AppNode from "../core/app_node";
import Progress from "../core/prefabs/progress";
import { RegClass } from "../core/serialize";
import Utils, { H5Utils, rAF } from "../core/utils";


@RegClass("PageUI")
export default class PageUI extends AppNode {
    dragContain: HTMLDivElement = null;
    dragItem: HTMLDivElement = null;

    pb: Progress = null;
    onLoad() {
        H5Utils.DragElement(this.dragItem, this.dragContain);
        let num = 0;
        rAF.set(() => {
            num += 1;
            if( num > 100 ){
                num = 0;
            }
            this.pb.progress = num;
        }, 100);
    }
    onClickMsgBox() {
        Utils.app.msgBox("12312312123123123123123123123");
    }
    onClickMsgBoxYesNo() {
        Utils.app.msgBoxYesNo("12312312123123123123123123123");
    }

};